home *** CD-ROM | disk | FTP | other *** search
- package pong;
-
- import javax.microedition.lcdui.Alert;
- import javax.microedition.lcdui.Display;
- import javax.microedition.midlet.MIDlet;
- import javax.microedition.midlet.MIDletStateChangeException;
-
- public class Pong extends MIDlet {
- static final String DIRECTIONS_TEXT = "Welcome to game Pong!\nThe goal of the game is to score points as many as you can.";
- private PongCourt court = new PongCourt(Display.getDisplay(this));
- private Alert directions = new Alert("Help");
-
- public Pong() {
- this.directions.setTimeout(-2);
- this.directions.setString("Welcome to game Pong!\nThe goal of the game is to score points as many as you can.");
- ExitHookup.hookup(this, this.court);
- }
-
- public void destroyApp(boolean var1) throws MIDletStateChangeException {
- this.court.destroy();
- }
-
- void help() {
- Display.getDisplay(this).setCurrent(this.directions);
- }
-
- public void pauseApp() {
- this.court.pause();
- }
-
- public void startApp() throws MIDletStateChangeException {
- Display.getDisplay(this).setCurrent(this.court);
- this.court.start();
- }
- }
-